import IndicatorCenter, { type IProps } from './fc';
import { defineAmisPlugin, getInputTpl } from '../../base/util';

export default defineAmisPlugin<IProps>(({ amisEditor }) => {
  const { getSchemaTpl } = amisEditor;

  return {
    component: IndicatorCenter,
    options: {
      type: 'indicator-center',
      name: '指标控件',
      order: 2,
      icon: 'FileImageOutlined',
      description: '指标控件',
      panelTitle: '指标控件',
      panelTabs: [
        {
          title: '常规',
          body: [
            getSchemaTpl('collapseGroup', [
              {
                title: '基本',
                body: [
                  getInputTpl('height', { label: '容器高度', type: 'number' }),
                  getInputTpl('gap', { label: '卡片间隔', type: 'number' })
                ]
              }
            ])
          ]
        },
        {
          title: '外观',
          body: [getSchemaTpl('collapseGroup', [...getSchemaTpl('theme:common', { styleName: 'style' })])]
        }
      ]
    }
  };
});
